<template>
  <a-layout-sider
    :class="['sider', 'shadow', theme, fixSidebar ? 'ant-fixed-sidemenu' : null]"
    width="256px"
    v-model="collapsed"
    :trigger="null"
  >
    <logo />
    <s-menu :collapsed="collapsed" :menu="menus" :theme="theme" style="padding: 16px 0;" />
  </a-layout-sider>
</template>

<script>
  import Logo from '@/components/base/tools/Logo'
  import SMenu from './index'
  import { mapState, mapActions } from 'vuex'
  export default {
    name: 'SideMenu',
    components: { Logo, SMenu },
    props: {
      theme: {
        type: String,
        required: false,
        default: 'dark',
      },
      collapsed: {
        type: Boolean,
        required: false,
        default: false,
      },
      fixSidebar: {
        type: Boolean,
        required: false,
        default: false,
      },
    },
    computed: {
      menus() {
        let menus = JSON.parse(sessionStorage.currentMenu).children
        return menus
      },
    },
  }
</script>

<style scoped lang="less"></style>
